<%--
  Created by IntelliJ IDEA.
  User: lys
  Date: 2020/8/20
  Time: 23:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>分类更新</title>
    <link rel="stylesheet" type="text/css" href="css\create.css">
    <script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
    <script type="text/javascript" src="js/validation.js"></script>
    <script type="text/javascript">
        <!-- 提交前表单校验 -->
        function checkSubmit(){
            var result = true;
            var r2 = checkEmpty("#second_cname","#errPname");
            var r3 = checkCategory('#first_cname', '#errCategory');
            if (r1 && r2 && r3 ){
                return true;
            }else{
                return false;
            }
        }
    </script>
</head>
<body>
<div class="container">
    <fieldset>
        <legend>分类更新</legend>
        <form action="management?method=cupdate" method="post">
            <%--autocomplete="off" enctype="multipart/form-data"--%>
            <%--onsubmit = "return checkSubmit()">--%>
            <%--<input type="hidden" name="second_cid" value="${stu.second_cid}">--%>
            <ul class="ulform">
                <li>
                    <%--<span>分类名</span>--%>
                    <%--<span id="errPid"></span>--%>
                    <input type="hidden" id="second_cid" name="second_cid" onblur="checkEmpty('#second_cid','#errPid')" value="${stu.second_cid}"/>
                </li>
                <li>
                    <span>分类名</span>
                    <span id="errPname"></span>
                    <input id="second_cname" name="second_cname" onblur="checkEmpty('#second_cname','#errPname')" value="${stu.second_cname}"/>
				</li>
                <li>
                    <span>一级分类</span>
                    <span id="errCategory"></span>
                    <select id="first_cname" name="first_cname" onchange="checkCategory('#first_cname','#errCategory')" value="${stu.first_cname}">
                        <option value="请选择分类" disabled="disabled">请选择分类</option>
                        <option value="国画" <c:if test="${stu.first_cname == '国画'}">selected="selected"</c:if>>国画</option>
                        <option value="西洋画" <c:if test="${stu.first_cname == '西洋画'}">selected="selected"</c:if>>西洋画</option>
                        <option value="书法" <c:if test="${stu.first_cname == '书法'}">selected="selected"</c:if>>书法</option>
                        <option value="雕塑" <c:if test="${stu.first_cname == '雕塑'}">selected="selected"</c:if>>雕塑</option>
                        <option value="紫砂陶瓷" <c:if test="${stu.first_cname == '紫砂陶瓷'}">selected="selected"</c:if>>紫砂陶瓷</option>
                        <option value="玉翠珠宝" <c:if test="${stu.first_cname == '玉翠珠宝'}">selected="selected"</c:if>>玉翠珠宝</option>
                    </select>
                </li>
                <li style="text-align: center;">
                    <button type="submit" class="btn-button">提交表单</button>
                </li>
            </ul>
        </form>
    </fieldset>
</div>
</body>
</html>
